package com.etooling.framework.entity;


import com.etooling.framework.svo.AbstractEntity;

import javax.persistence.*;
import java.util.Date;
import java.util.List;

/**
 * 使用机加保企业信息管理
 */
@Entity
@Table(name = "t_company", schema = "framework")
public class Company extends AbstractEntity {
    final public static String RUNNING_STATUS = "启用";
    final public static String STOP_STATUS = "停用";


    private String name;//企业名称

    private String nickName;//简称
    private Date createTime;
    private String orgCode; //编码
    private Date joinTime;//加入时间
    private Date endTime;//到期时间
    private String phone;//联系电话
    private String addr;//地址
    private String bankNo;//银行卡号
    private String bankName;//开户银行
    private String taxCode;//税号
    private String companyType;//公司类型
    private String parentId;//父机构id
    private AttachFile licenseImgFile;   //上传文件
    private String isSuperOrg;//超级机构（如果艾乐博，可以看全部其他企业）
    private String status;   //状态
    private AttachFile logoImg;    //上传Logo
    private AttachFile billQrCode; // 发票二维码
    private String handlerUserName;//负责人姓名
    private String handlerUserMobile;//负责人电话
    private String alias;//别名系统使用时自动替换

    public String getNickName() {
        return nickName;
    }

    public void setNickName(String nickName) {
        this.nickName = nickName;
    }

    @ManyToOne(targetEntity = AttachFile.class, fetch = FetchType.EAGER)
    @JoinColumn(name = "bill_code_file_id")
    public AttachFile getBillQrCode() {
        return billQrCode;
    }

    public void setBillQrCode(AttachFile billQrCode) {
        this.billQrCode = billQrCode;
    }

    public String getBankNo() {
        return bankNo;
    }

    public void setBankNo(String bankNo) {
        this.bankNo = bankNo;
    }

    public String getBankName() {
        return bankName;
    }

    public void setBankName(String bankName) {
        this.bankName = bankName;
    }

    public String getTaxCode() {
        return taxCode;
    }

    public void setTaxCode(String taxCode) {
        this.taxCode = taxCode;
    }

    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    public String getAlias() {
        return alias;
    }

    public void setAlias(String alias) {
        this.alias = alias;
    }

    public String getHandlerUserName() {
        return handlerUserName;
    }

    public void setHandlerUserName(String handlerUserName) {
        this.handlerUserName = handlerUserName;
    }

    public String getHandlerUserMobile() {
        return handlerUserMobile;
    }

    public void setHandlerUserMobile(String handlerUserMobile) {
        this.handlerUserMobile = handlerUserMobile;
    }

    public Date getEndTime() {
        return endTime;
    }

    public void setEndTime(Date endTime) {
        this.endTime = endTime;
    }

    @ManyToOne(targetEntity = AttachFile.class, fetch = FetchType.EAGER)
    @JoinColumn(name = "logo_img")
    public AttachFile getLogoImg() {
        return logoImg;
    }

    public void setLogoImg(AttachFile logoImg) {
        this.logoImg = logoImg;
    }

    @Transient
    private List<Company> children;

    @Transient
    public List<Company> getChildren() {
        return children;
    }

    @Transient
    public void setChildren(List<Company> children) {
        this.children = children;
    }

    public String getStatus() {
        return status;
    }

    public void setStatus(String status) {
        this.status = status;
    }

    public String getOrgCode() {
        return orgCode;
    }

    public void setOrgCode(String orgCode) {
        this.orgCode = orgCode;
    }

    public String getParentId() {
        return parentId;
    }

    public void setParentId(String parentId) {
        this.parentId = parentId;
    }

    public String getIsSuperOrg() {
        return isSuperOrg;
    }

    public void setIsSuperOrg(String isSuperOrg) {
        this.isSuperOrg = isSuperOrg;
    }

    @ManyToOne(targetEntity = AttachFile.class, fetch = FetchType.EAGER)
    @JoinColumn(name = "license_img_file_id")
    public AttachFile getLicenseImgFile() {
        return licenseImgFile;
    }

    public void setLicenseImgFile(AttachFile licenseImgFile) {
        this.licenseImgFile = licenseImgFile;
    }

    public String getCompanyType() {
        return companyType;
    }

    public void setCompanyType(String companyType) {
        this.companyType = companyType;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Date getJoinTime() {
        return joinTime;
    }

    public void setJoinTime(Date joinTime) {
        this.joinTime = joinTime;
    }

    public String getPhone() {
        return phone;
    }

    public void setPhone(String phone) {
        this.phone = phone;
    }

    public String getAddr() {
        return addr;
    }

    public void setAddr(String addr) {
        this.addr = addr;
    }
}